{-# LANGUAGE ForeignFunctionInterface#-}

{-
	created by dhhan, 2009 05 26
	IORef has memory leak
	So I made this FFI functions about very simple mutable variables(Int,Double).
-}

module MyFFI where

import Foreign.Ptr

foreign import ccall "intNew" cIntNew::Int->IO IntPtr
foreign import ccall "intSet" cIntSet::IntPtr->Int->IO ()
foreign import ccall "intGet" cIntGet::IntPtr->IO Int


foreign import ccall "doubleNew" cDoubleNew::Double->IO (Ptr Double)
foreign import ccall "doubleSet" cDoubleSet::Ptr Double->Double->IO ()
foreign import ccall "doubleGet" cDoubleGet::Ptr Double->IO Double
